#include<bits/stdc++.h>
#define ll long long
#define L (x<<1)
#define R (L|1)
#define mid (l+r>>1)
#define lc L,l,mid
#define rc R,mid+1,r
#define OK Ll<=l&&r<=Rr
#define Root 1,1,n
#define rep(x,y,z) for(int x=(y);x<=(z);x++)
#define per(x,y,z) for(int x=(y);x>=(z);x--)
#define repn(x) rep(x,1,n)
#define repm(x) rep(x,1,m)
#define pb push_back
#define e(x) for(int i=h[x],y=to[i];i;i=nxt[i],y=to[i])
#define E(x) for(auto y:p[x])
#define Pi pair<int,int>
#define ui unsigned ll
inline int read(){int s=0,w=1;char c=getchar();while(c<48||c>57) {if(c=='-') w=-1;c=getchar();}while(c>=48&&c<=57)s=(s<<1)+(s<<3)+c-48,c=getchar();return s*w;}
inline void pf(ll x){if(x<0) putchar('-'),x=-x;if(x>9)pf(x/10);putchar(x%10+48);}
using namespace std;
const int N =2e5+5,M=1e6+5,inf=(1LL<<30)-1,mod=998244853;
const ll llf=1e18;
inline void add(int &a,int b){((a+=b)>=mod) and (a-=mod);}
inline int Add(int a,int b){return add(a,b),a;}
inline int mul(int a,int b){return 1LL*a*b%mod;}
inline void Mul(int &a,int b){a=mul(a,b);}
inline void red(int &a,int b){add(a,mod-b);}
inline int Red(int a,int b){return red(a,b),a;}
inline int qp(int a,int b){if(!b)return 1;int c=qp(a,b>>1);Mul(c,c);if(b&1)Mul(c,a);return c;}
inline int INV(int x){return qp(x,mod-2);}
int n,m,q,h[M],to[M*22],nxt[M*22],cnt,val[N];
inline void add_(int a,int b){
	to[++cnt]=b,nxt[cnt]=h[a],h[a]=cnt;
}
int dep[N],siz[N],son[N],top[N],f[N];
inline void dfs(int x,int fa){
	f[x]=fa,dep[x]=dep[fa]+1,siz[x]=1;
	e(x)if(y^fa)dfs(y,x),siz[x]+=siz[y],son[x]=siz[y]>siz[son[x]]?y:son[x];
}
inline void Dfs(int x,int low){
	top[x]=low;
	if(son[x])Dfs(son[x],low);
	e(x)if(y^f[x]&&y^son[x])Dfs(y,y);
}
inline int lca(int x,int y){
	while(top[x]^top[y])dep[top[x]]>dep[top[y]]?x=f[top[x]]:y=f[top[y]];
	return dep[x]<dep[y]?x:y;
}
inline int dist(int x,int y){
	return dep[x]+dep[y]-dep[lca(x,y)]*2;
}
struct ylx{
	int x,y,p;
}qs[N];
bitset<1005>b[1005];
int tot,dis[1005][1005],bel[M],rd[M],dfn[M],low[M],Time,s[M],tp;
bool instac[M];
vector<int>p[M],ed[1005];
inline void tarjan(int x){
	dfn[x]=low[x]=++Time,s[++tp]=x,instac[x]=1;
	E(x)if(!dfn[y])tarjan(y),low[x]=min(low[x],low[y]);
	else if(instac[y])low[x]=min(low[x],dfn[y]);
	if(dfn[x]==low[x]){
		tot++;
		for(int y=s[tp--];;y=s[tp--]){
			bel[y]=tot,b[tot][y]=1,instac[y]=0;
			if(y==x)return;
		}
	}
}
inline void subtask1(){
	dfs(1,0),Dfs(1,1);
	repn(i)rep(j,i+1,n)dis[i][j]=dis[j][i]=dist(i,j);
	repn(i)repn(j)if(i^j&&dis[i][j]<=val[i])p[i].pb(j);
	repn(i)if(!dfn[i])tarjan(i);
	repn(x)E(x)if(bel[x]^bel[y])ed[bel[y]].pb(bel[x]),rd[bel[x]]++;
	queue<int>qq;
	rep(i,1,tot)if(!rd[i])qq.push(i);
	while(!qq.empty()){
		int x=qq.front();qq.pop();
		for(auto y:ed[x]){
			b[y]|=b[x];
			if(!--rd[y])qq.push(y);
		}
	}
	rep(o,1,q){
		int x=qs[o].x,y=qs[o].y;
		if(dis[x][y]<qs[o].p||b[bel[x]][y]){
			puts("YES");
			continue;
		}
		if(qs[o].p<=val[x]){
			puts("NO");
			continue;
		}
		bool fl=0;
		repn(i)if(dis[x][i]<=qs[o].p){
			if(b[bel[i]][y]){
				fl=1;
				break;
			}
		}
		puts(fl?"YES":"NO");
	}
}
inline void build(int x,int l,int r){
	if(l==r)return add_(x+n,l),void();
	add_(x+n,L+n),add_(x+n,R+n),build(lc),build(rc);
}
inline void modify(int x,int l,int r,int Ll,int Rr,int fr){
	if(OK)return add_(fr,x+n),void();
	if(Ll<=mid)modify(lc,Ll,Rr,fr);
	if(Rr>mid)modify(rc,Ll,Rr,fr);
}
int le[M],re[M];
inline void Tarjan(int x){
	dfn[x]=low[x]=++Time,s[++tp]=x,instac[x]=1;
	e(x)if(!dfn[y])Tarjan(y),low[x]=min(low[x],low[y]);
	else if(instac[y])low[x]=min(low[x],dfn[y]);
	if(dfn[x]==low[x]){
		tot++,le[tot]=n+1;
		for(int y=s[tp--];;y=s[tp--]){
			if(y<=n)re[tot]=max(re[tot],y),le[tot]=min(le[tot],x);
			bel[y]=tot,instac[y]=0;
			if(y==x)return;
		}
	}
}

inline bool query(int x,int l,int r,int Ll,int Rr,int y){
	if(OK)return y>=le[bel[x+n]]&&y<=re[bel[x+n]];
	if(Rr<=mid)return query(lc,Ll,Rr,y);
	if(Ll>mid)return query(rc,Ll,Rr,y);
	return query(lc,Ll,Rr,y)|query(rc,Ll,Rr,y);
}
inline void subtaskspe(){
	repn(i)h[i]=0;cnt=0;
	build(Root);
	repn(i)if(val[i]){
		int l=max(1,i-val[i]),r=min(n,i+val[i]);
		modify(Root,l,r,i);
	}
	rep(i,1,n*5)if(!dfn[i])Tarjan(i);
	rep(x,1,n*5)e(x)if(bel[x]^bel[y])p[bel[y]].pb(bel[x]),rd[bel[x]]++;
	queue<int>qq;
	rep(i,1,tot)if(!rd[i])qq.push(i);
	int C=0;
	while(!qq.empty()){
		int x=qq.front();qq.pop();
		C++;
		E(x){
			re[y]=max(re[y],re[x]),le[y]=min(le[y],le[x]);
			if(!--rd[y])qq.push(y);
		}
	}
	rep(o,1,q){
		int x=qs[o].x,y=qs[o].y,k=qs[o].p;
		if(y>=le[bel[x]]&&y<=re[bel[x]]){
			puts("YES");
			continue;
		}
		if(k<=val[x]){
			puts("NO");
			continue;
		}
		int l=max(1,x-k),r=min(n,x+k);
		puts(query(Root,l,r,y)?"YES":"NO");
	}
}
inline void Main(){
	n=read(),m=read(),q=read();
	bool spe=1;
	rep(i,2,n){
		int x=read(),y=read();
		add_(x,y),add_(y,x);
		spe&=x==i-1&&y==i;
	}
	rep(i,1,q)qs[i].x=read(),qs[i].y=read(),qs[i].p=read();
	repm(i){
		int x=read(),y=read();
		val[x]=max(val[x],y);
	}
	if(n<=1000&&m<=1000&&q<=1000)return subtask1(),void();
	if(spe)return subtaskspe(),void();
}
signed main(){
//	cerr<<(&S-&E)/1024/1024<<"MB.\n";
	freopen("shu.in","r",stdin);
	freopen("shu.out","w",stdout);
	int T=1;
	while(T--)Main(); 
	return 0;
}
